package com.zidian.teacher.bean;

import java.util.List;

/**
 * Created by Administrator on 2016/9/6 0006.
 */
public class GroupBean {
    private String groupingId;
    private String groupName;
    private String groupTotal;
    private List<StudyBean> studyBeans;
    private boolean isAllSelect;
    private boolean isSelect;

    public GroupBean(String groupName, String groupTotal, String groupingId, boolean isAllSelect, boolean isSelect, List<StudyBean> studyBeans) {
        this.groupName = groupName;
        this.groupTotal = groupTotal;
        this.isAllSelect = isAllSelect;
        this.studyBeans = studyBeans;
        this.isSelect = isSelect;
        this.groupingId = groupingId;
    }

    public String getGroupingId() {
        return groupingId;
    }

    public void setGroupingId(String groupingId) {
        this.groupingId = groupingId;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setIsSelect(boolean isSelect) {
        this.isSelect = isSelect;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getGroupTotal() {
        return groupTotal;
    }

    public void setGroupTotal(String groupTotal) {
        this.groupTotal = groupTotal;
    }

    public List<StudyBean> getStudyBeans() {
        return studyBeans;
    }

    public void setStudyBeans(List<StudyBean> studyBeans) {
        this.studyBeans = studyBeans;
    }

    public boolean isAllSelect() {
        return isAllSelect;
    }

    public void setIsAllSelect(boolean isAllSelect) {
        this.isAllSelect = isAllSelect;
    }

    public void setAllSelect(boolean isall) {
        for (int i = 0; i < studyBeans.size(); i++) {
            studyBeans.get(i).setIsSelect(isall);
        }
    }

    public boolean getAllSelect() {
        boolean isall = true;

        for (int i = 0; i < studyBeans.size(); i++) {
            if (!studyBeans.get(i).isSelect()) {
                isall = false;
            }
        }
        return isall;
    }

}
